# Import required modules
import csv
import sqlite3

# Connecting to the geeks database
connection = sqlite3.connect('../db.sqlite3')

# Creating a cursor object to execute
# SQL queries on a database table
cursor = connection.cursor()

# Table Definition
create_table = '''
create table data_Circumstance
(
    ICSheet text not null,
    CSheet text not null,
    Like text,
    CommentID text,
    Collection text,
    constraint circumstance_pk
        primary key (ICSheet,CSheet)
);


'''
#
# cursor.execute(create_table)
# file = open('../GetInfo/Details/ChassisInfo.csv', encoding='utf-8')
# contents = csv.reader(file)
# insert_records = "INSERT INTO data_Circumstance (ICSheet,CSheet,Like,CommentID,Collection) " \
#                  "VALUES(?, ?, ?, ?, ?)"
#
# cursor.executemany(insert_records, contents)
# select_all = "SELECT * FROM data_Chassis"
# rows = cursor.execute(select_all).fetchall()
# for r in rows:
#     print(r)
#
# # Committing the changes
# connection.commit()
# connection.close()
